package xyz.ssf.cloud.project.system.domain.vo;

import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 密码更新视图对象
 * 
 * @author ssf
 */
@Data
public class PasswordUpdateVO implements Serializable {
    
    private static final long serialVersionUID = 1L;

    /** 旧密码 */
    @NotBlank(message = "旧密码不能为空")
    private String oldPassword;
    
    /** 新密码 */
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,20}$", 
             message = "密码必须包含大小写字母和数字，长度在8-20之间")
    private String newPassword;
    
    /** 确认密码 */
    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;
} 